function getElementNodes(selector, opt) {
  const { selectAll = false, scope } = opt || {};
  let query = uni.createSelectorQuery().in(scope);
  return selectAll ? query.selectAll(selector) : query.select(selector);
}
function getElementBounding(opt) {
  return new Promise((resolve) => {
    const { el, selector, selectAll = false, scope } = opt || {};
    if (el) {
      el.boundingClientRect(resolve).exec();
      return;
    }
    getElementNodes(selector, { scope, selectAll }).boundingClientRect(resolve).exec();
  });
}
function getChildrenComponents(scope, name) {
  let result = scope.proxy.$children || [];
  if (name)
    result = result.filter((a) => a.$options.name === name);
  return result;
}
export {
  getChildrenComponents,
  getElementBounding,
  getElementNodes
};
